< previous page page_806 next page >

Page 806
You need to add only a few lines of code to this form. First, add the code shown in Listing 21.11 to the declaration area of the form.
Type.gifListing 21.11. Coding the declaration section of the form.
Option Explicit
'
' public vars
Public blnOK As Boolean
Public strTitle As String
Next, add the code in Listing 21.12 to the Form_Activate event to initialize form values at startup.
Type.gifListing 21.12. Initializing form values.
Private Sub Form_Activate()
    '
    ' form setup
    '
    lblAppTitle = strTitle
    txtUserID = ""
    txtPassword = ""
    txtUserID.SetFocus
    '
End Sub
You need to add a few lines to support the command buttons. First, add the code in Listing 21.13 for the OK button.
Type.gifListing 21.13. Code for the OK button.
Private Sub cmdOK_Click()
    '
    blnOK = True
    Me.Hide
    '
End Sub
This code sets a global variable and hides the login form. Now add the code from Listing 21.14 to support the Cancel button.

 
< previous page page_806 next page >

If you like this book, buy it!